/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * VentanaPrincipal2.java
 *
 * Created on Aug 13, 2010, 4:08:28 AM
 */


package ventanas;
import javax.swing.JFrame;

/**
 *
 * @author mimi
 */
public class VentanaPrincipal2 extends javax.swing.JFrame {

    /** Creates new form VentanaPrincipal2 */
    public VentanaPrincipal2() {
        initComponents();
         this.ventanaPadre = null;
    }

     public VentanaPrincipal2(JFrame ventanaPadre)
    {
        initComponents();
        this.ventanaPadre = ventanaPadre;
    }


    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        JLImagen3Personas = new javax.swing.JLabel();
        JBAcceder = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        JLImagen3Personas.setIcon(new javax.swing.ImageIcon(getClass().getResource("/presentacion/Domino2.jpg"))); // NOI18N
        JLImagen3Personas.setText("jLabel1");

        JBAcceder.setText("Acceder");
        JBAcceder.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JBAccederActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(JLImagen3Personas, javax.swing.GroupLayout.PREFERRED_SIZE, 368, Short.MAX_VALUE)
                        .addContainerGap())
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addComponent(JBAcceder, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(23, 23, 23))))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(JLImagen3Personas, javax.swing.GroupLayout.PREFERRED_SIZE, 316, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 10, Short.MAX_VALUE)
                .addComponent(JBAcceder))
        );

        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        setBounds((screenSize.width-394)/2, (screenSize.height-399)/2, 394, 399);
    }// </editor-fold>//GEN-END:initComponents

    private void JBAccederActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JBAccederActionPerformed
        // TODO add your handling code here:
             this.setVisible(false);
        VentanaSecundaria ventanaSecundaria = new VentanaSecundaria();
        ventanaSecundaria.setVisible(true);
        ventanaSecundaria.setVentanaPadre(this);
    }//GEN-LAST:event_JBAccederActionPerformed

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new VentanaPrincipal2().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton JBAcceder;
    private javax.swing.JLabel JLImagen3Personas;
    // End of variables declaration//GEN-END:variables
    javax.swing.JFrame ventanaPadre;
}
